package com.huilian.iotbox.admin.controller;

import com.huilian.iotbox.admin.service.DeviceTypeService;
import com.huilian.iotbox.admin.service.UserService;
import com.huilian.iotbox.data.common.ServerResponse;
import com.huilian.iotbox.data.controller.BaseController;
import com.huilian.iotbox.data.vo.UserInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * @date 2021/1/9 11:33
 */
@RestController
@RequestMapping("/api/deviceType")
public class DeviceTypeController extends BaseController {
    @Autowired
    private UserService userService;
    @Resource
    private DeviceTypeService deviceTypeService;

    @GetMapping("/findAllDeviceType")
    public ServerResponse findAllDeviceType(HttpServletRequest request) {
        UserInfo userInfo = userService.getLoginUserInfo(request);
        return ServerResponse.createBySuccess(deviceTypeService.findAllDeviceType());
    }

}
